(()=>{
    // 定义一个接口
    interface IPerson {
        firstName:string
        lastName:string
    }

    // 定义一个类
    class Person {
        // 定义公共的字段（属性）
        firstName:string
        lastName:string
        fullName:string
        // 定义一个构造器函数
        constructor(firstName:string, lastName:string) {
            this.firstName = firstName
            this.lastName = lastName
            this.fullName = firstName + lastName
        }
    }

    function showFullName(person:Person) {
        return person.fullName
    }

    // 实例化对象
    const person = new Person('诸葛', '孔明')
    console.log(showFullName(person))
})()